<template>
   <p>{{ word }}</p>
   <input type="button" value="反转世界" v-on:click="reverseStr">
</template>

<script>
import { ref } from 'vue'
export default {
  name: 'app',
  setup(){
    const word = ref('Hello,World')
        const reverseStr = () => {
            // 反转后的数组
           let arr= word.value.split('').reverse();
           word.value= arr.join('')
           
        }

        return { word, reverseStr }
  }
}
</script>

<style>
    p{
        font-size: 40px;
        font-weight: bold;
    }
</style>